<template>
  <div class="sign-bg">
    <div class="sign-star1"></div>
    <div class="sign-star2"></div>
    <div class="sign-character"></div>
    <div class="sign-heistar"></div>
    <blink-star
      :stars="[
        { left: '3.5rem', top: '0.5rem', type: '--yellow-square' },
        { left: '5.5rem', top: '0.5rem' },
        { left: '5.5rem', top: '2.5rem', type: '--yellow-bling' },
        { left: '5.5rem', top: '4.5rem' },
        { left: '0.5rem', top: '6.5rem' },
        { left: '1.8rem', top: '7.0rem' },
        { left: '2.8rem', top: '7.5rem' },
        { left: '3.8rem', top: '7.9rem' },
        { left: '3.6rem', top: '8.9rem' },
        { left: '4.6rem', top: '9.5rem' },
        { left: '5.6rem', top: '8.5rem' },
        { left: '1.6rem', top: '8.8rem', type: '--yellow-bling' },
        { left: '5.6rem', top: '9.8rem', type: '--purpple' },
        { left: '4.6rem', top: '10.8rem', type: '--purpple' },
        { left: '5.6rem', top: '11.8rem', type: '--purpple' },
      ]"
    />
    <shooting-star />
    <arrows-icon v-if="isSigninPlayAnimation" class="icon_arrows" />
    <div class="signtext">
      <div :class="['signindays', { signinAnimation: isSigninPlayAnimation }]">
        <span>过去的
          <span style="font-size: 0.4rem; color: #ffc811; font-weight: 600">
            2021</span>
          年</span>
        <br>
        <span>你累计签到了
          <span style="font-size: 0.4rem; color: #ffc811; font-weight: 600">{{
            signin.sign_days
          }}</span>
          天</span>
      </div>
      <br>
      <div :class="['signintitle', { signinAnimation: isSigninPlayAnimation }]">
        <span>
          {{ signin.award_language1 }}
          <span
            style="font-size: 0.4rem; color: #ffc811; font-weight: 600"
          >【{{ signin.award_language2 }}】</span></span>
      </div>
      <br><br>
      <div :class="['siginreview', { signinAnimation: isSigninPlayAnimation }]">
        <span class="awardstext">
          {{ signin.award_language3 }}
        </span>
      </div>
    </div>
  </div>
</template>

<script>
import blinkStar from '../components/blink-star.vue'
export default {
  components: { blinkStar },
  props: {
    signin: {
      type: Object,
      default () {
        return {}
      }
    },
    isSigninPlayAnimation: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    isSigninPlayAnimation: {
      handler (value) {
        console.log(value, '----value isSigninPlayAnimation')
      },
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
body .icon_arrows {
  animation-delay: 4.5s;
}
.sign-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("./images/C_bg.jpg");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: 0 100%;
  overflow: hidden;
}
.sign-star1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.06rem;
  height: 2.43rem;
  background-image: url("./images/C_star1.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: star1 6s infinite;
  @keyframes star1 {
    50% {
      top: -5%;
    }
    100% {
      top: 0;
    }
  }
}
.sign-star2 {
  position: absolute;
  top: 1.3%;
  right: 0;
  width: 1.46rem;
  height: 1.08rem;
  background-image: url("./images/C_star2.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: star2 6s infinite;
  @keyframes star2 {
    50% {
      top: 4.3%;
    }
    100% {
      top: 1.3%;
    }
  }
}
.sign-character {
  position: absolute;
  top: 63%;
  left: 0;
  width: 3.33rem;
  height: 4.53rem;
  background-image: url("./images/C_character.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: character 4s infinite;
  @keyframes character {
    50% {
      top: 60%;
    }
    100% {
      top: 63%;
    }
  }
}
.sign-heistar {
  position: absolute;
  top: 65%;
  right: 35.2%;
  width: 1.56rem;
  height: 1.53rem;
  background-image: url("./images/C_heistar.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: heistar 4s infinite;
  @keyframes heistar {
    50% {
      top: 68%;
    }
    100% {
      top: 65%;
    }
  }
}
.sign-smallstar1 {
  position: absolute;
  top: 2.8%;
  left: 24.4%;
  width: 0.24rem;
  height: 0.46rem;
  background-image: url("./images/C_smallstar1.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: smallstart 3s infinite;
  @keyframes smallstart {
    0%,
    100% {
      transform: scale(0.6);
      opacity: 0;
    }
    50% {
      transform: scale(1);
      opacity: 1;
    }
  }
}
.sign-smallstar2 {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("./images/C_smallstar2.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  animation: smallstart2 3s infinite;
}
.sign-smallstar3 {
  position: absolute;
  bottom: 10.5%;
  left: 9.6%;
  width: 4.83rem;
  height: 4.6rem;
  background-repeat: no-repeat;
  background-image: url("./images/C_smallstar3.png");
  background-size: 100% auto;
  animation: smallstart2 3s infinite;
}

@keyframes smallstart2 {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes tail {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.signtext {
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  padding: 0 0.55rem 0 0.89rem;
  font-size: 0.32rem;
  color: #fff;
  .signindays {
    animation-delay: 0;
    animation-fill-mode: forwards;
    transform: translateX(-4.4rem);
  }
  .signintitle {
    animation-delay: 1.5s;
    animation-fill-mode: forwards;
    transform: translateX(-7rem);
  }
  .siginreview {
    animation-delay: 3s;
    animation-fill-mode: forwards;
    transform: translateX(-7rem);
    .awardstext{
      font-size: 0.4rem;
      font-weight: bold;
      color: rgb(255, 200, 17);
    }
  }
  .signinAnimation {
    animation-name: fadeInLeft;
    animation-duration: 1s;
  }
}
@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-2.2rem);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInTop {
  0% {
    opacity: 0;
  }

  33% {
    opacity: 0;
  }

  66% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
</style>
